<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:decorate template="/tema/padrao.xhtml">
        <ui:define name="centro">    
    
        <h:form id="form">

	<p:dataGrid var="bem" value="#{imovelBean.imoveis}" columns="3"
		rows="12" paginator="true"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
		rowsPerPageTemplate="9,12,15">
		
		<p:column>
			<p:panel header="#{bem.tipo}" style="text-align:center">
				<h:panelGrid columns="1" style="width:100%">
					<p:graphicImage value="/tema/uploads/#{bem.caminho}"/> 
				
					<h:outputText value="#{bem.opcao}" />
                                        <h:outputText value="#{bem.bairro}" />
                                        
					<p:commandLink update=":form:bemDetail" oncomplete="Dialog.show()" title="View Detail">
						<p:graphicImage value="/tema/imagens/search.png"/> 
						<f:setPropertyActionListener value="#{bem}" target="#{imovelBean.selectedImovel}" />
					</p:commandLink>
				</h:panelGrid>
			</p:panel>
		</p:column>

	</p:dataGrid>
	
	<p:dialog  header="Detalhes" widgetVar="Dialog" resizable="false">
		<p:outputPanel id="bemDetail" style="text-align:center;" layout="block">
		
			<p:graphicImage value="/tema/uploads/#{imovelBean.selectedImovel.caminho}"/>
			
			<h:panelGrid  columns="2" cellpadding="5">
				                           
                                <h:outputLabel for="codImovel" value="Cod: "  />
                                <h:outputText id="codImovel" value="#{imovelBean.selectedImovel.codImovel}" />
                                
                                <h:outputLabel for="codDono" value="Cod Proprietário: "  />
                                <h:outputText converter="proprietarioConverter" id="codDono" value="#{imovelBean.selectedImovel.dono}" />
                                
                                <h:outputLabel for="opcao" value="Opção: " />	                                
                                <h:outputText id="opcao" value="#{imovelBean.selectedImovel.opcao}" />

                                <h:outputLabel for="tipo" value="Tipo: " />			                              
                                <h:outputText  id="tipo" value="#{imovelBean.selectedImovel.tipo}"/>

                                <h:outputLabel for="valor" value="Valor: " />	
                                <h:outputText id="valor" value="#{imovelBean.selectedImovel.valor}" />
                                
                                <h:outputLabel for="areaTotal" value="Área Total: " />	
                                <h:outputText id="areaTotal" value="#{imovelBean.selectedImovel.areaTotal}"/> 
                                
                                <h:outputLabel for="areaUtil" value="Área Útil: " />	
                                <h:outputText id="areaUtil" value="#{imovelBean.selectedImovel.areaUtil}"/> 
   
                                <h:outputLabel for="numQuartos" value="Nº Quartos: " />	
                                <h:outputText id="numQuartos" value="#{imovelBean.selectedImovel.numQuartos}"/> 
    
                                <h:outputLabel for="numSuites" value="Nº Suítes: " />	
                                <h:outputText id="numSuites" value="#{imovelBean.selectedImovel.numSuites}"/> 
                                
                                <h:outputLabel for="numGaragens" value="Nº Garagens: " />	
                                <h:outputText id="numGaragens" value="#{imovelBean.selectedImovel.numGaragens}"/> 
                                
                                <h:outputLabel for="estado" value="Estado: " />	
                                <h:outputText id="estado" value="#{imovelBean.selectedImovel.estado}"/> 
                                
                                <h:outputLabel for="cidade" value="cidade: " />	
                                <h:outputText id="cidade" value="#{imovelBean.selectedImovel.cidade}"/> 
                                
                                <h:outputLabel for="bairro" value="Bairro: " />	
                                <h:outputText id="bairro" value="#{imovelBean.selectedImovel.bairro}"/> 
                                
                                <h:outputLabel for="endereco" value="Endereço: " />	
                                <h:outputText id="endereco" value="#{imovelBean.selectedImovel.endereco}"/> 
                                
                                <h:outputLabel for="obs" value="Obs: " />	
                                <h:outputText id="obs" value="#{imovelBean.selectedImovel.obs}"/> 
                                
                            </h:panelGrid>
                    </p:outputPanel>
                </p:dialog>
            </h:form>
        </ui:define>
    </ui:decorate>
</html>

